
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>
        文章类型
    </title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../statics/css/x-admin.css" media="all">
</head>
<body>
<div class="x-nav">
            <span class="layui-breadcrumb">
              <a><cite>首页</cite></a>
              <a><cite>销售栏目</cite></a>
              <a><cite>团购活动</cite></a>
              
            </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"  href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">
    <form class="layui-form x-center" action="" style="width:800px">
        <div class="layui-form-pane" style="margin-top: 15px;">
            <div class="layui-form-item">
                <div class="layui-input-inline">
                    <input type="text" name="username"  placeholder="放弃吧，查不到的" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-input-inline" style="width:80px">
                    <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
                </div>
            </div>
        </div>
    </form>

        <button class="layui-btn" onclick="member_add('添加文章类型','articletypeadd.html','600','500')"><i class="layui-icon">&#xe608;</i>不起眼的按钮</button>
        <span class="x-right" style="line-height:40px">共有数据：<span id="totalCount" class="layui-badge">66</span> 条</span></xblock>
    <table class="layui-table">
        <thead id="tbody">
        <tr>
            <th>
                ID
            </th>
            <th>
                            团购活动
            </th>
            <th>
                             数量
            </th>
            <th>
                             价格
            </th>
            <th>
                备注
            </th>
        </tr>
        </thead>
        <tbody>
       
        </tbody>
    </table>

    <div id="page">
    	
    </div>
</div>
<script src="../statics/lib/layui/layui.js" charset="utf-8"></script>
<script src="../statics/js/x-layui.js" charset="utf-8"></script>
<script src="../statics/js/jquery.min.js" charset="utf-8"></script>
<script>
$(function(){
	ListStudent(1);
})

    layui.use(['laydate','element','laypage','layer'], function(){
        $ = layui.jquery;//jquery
        laydate = layui.laydate;//日期插件
        lement = layui.element();//面包导航
        laypage = layui.laypage;//分页
        layer = layui.layer;//弹出层

        //以上模块根据需要引入
        var start = {
            min: laydate.now()
            ,max: '2099-06-16 23:59:59'
            ,istoday: false
            ,choose: function(datas){
                end.min = datas; //开始日选好后，重置结束日的最小日期
                end.start = datas //将结束日的初始值设定为开始日
            }
        };

        var end = {
            min: laydate.now()
            ,max: '2099-06-16 23:59:59'
            ,istoday: false
            ,choose: function(datas){
                start.max = datas; //结束日选好后，重置开始日的最大日期
            }
        };

        document.getElementById('LAY_demorange_s').onclick = function(){
            start.elem = this;
            laydate(start);
        }
        document.getElementById('LAY_demorange_e').onclick = function(){
            end.elem = this
            laydate(end);
        }

    });

 


 
    // 用户-编辑
    function member_edit (title,url,id,w,h) {
        x_admin_show(title,url,w,h);
    }
    /*密码-修改*/
    function member_password(title,url,id,w,h){
        x_admin_show(title,url,w,h);
    }
$.ajax({
    url: "http://localhost:8080/fruit/lookall",
    async: false,
    type: "GET",
    success: function (res){
        datas = res;
        let len = res.length;
        for (let i=0;i<len;i++){
            let data = datas[i];
            let tr = document.createElement("tr");
            tr.setAttribute('id', 'tr' + parseInt(i + 1));
            document.getElementById('tbody').appendChild(tr);
            var t0 = document.createElement("td");
            t0.innerText =data.fruit_id;
            document.getElementById('tr' + parseInt(i + 1)).appendChild(t0);
            var t1 = document.createElement("td");
            t1.innerText = data.fruit_name;
            document.getElementById('tr' + parseInt(i + 1)).appendChild(t1);
            let t2 = document.createElement("td");
            t2.innerText = data.fruit_num;
            document.getElementById('tr' + parseInt(i + 1)).appendChild(t2);
            let t3 = document.createElement("td");
            t3.innerText = data.fruit_price;
            document.getElementById('tr' + parseInt(i + 1)).appendChild(t3);
            let t4 = document.createElement("td");
            t4.innerText = data.fruit_photo;
            document.getElementById('tr' + parseInt(i + 1)).appendChild(t4);
        }
    }
})
</script>

</body>
</html>